import request from '@/utils/request.js'

export const teacherListService =  (params) => {
    return request.get('/admin/allTeacher', { params: params });
};

export const teacherSearchService =  (searchForm,params) => {
    return request.post('/admin/findTeacher', searchForm,{params: params});
};


export const teacherAddService = (teacher) => {
    return request.get('/admin/addTeacher', {
        params: {
            account: teacher.account,
            userName: teacher.userName,
            role: teacher.role
        }
    });
};

export const teacherDeleteService = (teacherId)=>{
    return request.get(`/admin/deleteTeacher?id=${teacherId}`,)
}

export const resetPasswordService = (teacherId)=>{
    return request.get(`/admin/resetPassword?id=${teacherId}`,)
}

export const teacherUpdateService=(params)=>{
    return request.get('/admin/updateTeacher',{
        params: {
            id: params.id,
            userName: params.userName,
            role: params.role
        }
    });
};